home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib / tk / place.man < prev    next >
Encoding:
Text File  |  1992-08-24  |  13.0 KB  |  403 lines

  1. '\"
  2. '\" Copyright 1992 Regents of the University of California
  3. '\" Permission to use, copy, modify, and distribute this
  4. '\" documentation for any purpose and without fee is hereby
  5. '\" granted, provided that this notice appears in all copies.
  6. '\" The University of California makes no representations about
  7. '\" the suitability of this material for any purpose.  It is
  8. '\" provided "as is" without express or implied warranty.
  9. '\" 
  10. '\" $Header: /user6/ouster/wish/man/RCS/place.man,v 1.1 92/03/21 17:35:51 ouster Exp $ SPRITE (Berkeley)
  11. '/" 
  12. .\" The definitions below are for supplemental macros used in Sprite
  13. .\" manual entries.
  14. .\"
  15. .\" .HS name section [date [version]]
  16. .\"    Replacement for .TH in other man pages.  See below for valid
  17. .\"    section names.
  18. .\"
  19. .\" .AP type name in/out [indent]
  20. .\"    Start paragraph describing an argument to a library procedure.
  21. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  22. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  23. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  24. .\"    needed;  use .AS below instead)
  25. .\"
  26. .\" .AS [type [name]]
  27. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  28. .\"    name are examples of largest possible arguments that will be passed
  29. .\"    to .AP later.  If args are omitted, default tab stops are used.
  30. .\"
  31. .\" .BS
  32. .\"    Start box enclosure.  From here until next .BE, everything will be
  33. .\"    enclosed in one large box.
  34. .\"
  35. .\" .BE
  36. .\"    End of box enclosure.
  37. .\"
  38. .\" .VS
  39. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  40. .\"    of man pages.
  41. .\"
  42. .\" .VE
  43. .\"    End of vertical sidebar.
  44. .\"
  45. .\" .DS
  46. .\"    Begin an indented unfilled display.
  47. .\"
  48. .\" .DE
  49. .\"    End of indented unfilled display.
  50. .\"
  51. '\"    # Heading for Sprite man pages
  52. .de HS
  53. .if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  54. .if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  55. .if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  56. .if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  57. .if t .wh -1.3i ^B
  58. .nr ^l \\n(.l
  59. .ad b
  60. ..
  61. '\"    # Start an argument description
  62. .de AP
  63. .ie !"\\$4"" .TP \\$4
  64. .el \{\
  65. .   ie !"\\$2"" .TP \\n()Cu
  66. .   el          .TP 15
  67. .\}
  68. .ie !"\\$3"" \{\
  69. .ta \\n()Au \\n()Bu
  70. \&\\$1    \\fI\\$2\\fP    (\\$3)
  71. .\".b
  72. .\}
  73. .el \{\
  74. .br
  75. .ie !"\\$2"" \{\
  76. \&\\$1    \\fI\\$2\\fP
  77. .\}
  78. .el \{\
  79. \&\\fI\\$1\\fP
  80. .\}
  81. .\}
  82. ..
  83. '\"    # define tabbing values for .AP
  84. .de AS
  85. .nr )A 10n
  86. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  87. .nr )B \\n()Au+15n
  88. .\"
  89. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  90. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  91. ..
  92. '\"    # BS - start boxed text
  93. '\"    # ^y = starting y location
  94. '\"    # ^b = 1
  95. .de BS
  96. .br
  97. .mk ^y
  98. .nr ^b 1u
  99. .if n .nf
  100. .if n .ti 0
  101. .if n \l'\\n(.lu\(ul'
  102. .if n .fi
  103. ..
  104. '\"    # BE - end boxed text (draw box now)
  105. .de BE
  106. .nf
  107. .ti 0
  108. .mk ^t
  109. .ie n \l'\\n(^lu\(ul'
  110. .el \{\
  111. .\"    Draw four-sided box normally, but don't draw top of
  112. .\"    box if the box started on an earlier page.
  113. .ie !\\n(^b-1 \{\
  114. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  115. .\}
  116. .el \}\
  117. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  118. .\}
  119. .\}
  120. .fi
  121. .br
  122. .nr ^b 0
  123. ..
  124. '\"    # VS - start vertical sidebar
  125. '\"    # ^Y = starting y location
  126. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  127. .de VS
  128. .mk ^Y
  129. .ie n 'mc \s12\(br\s0
  130. .el .nr ^v 1u
  131. ..
  132. '\"    # VE - end of vertical sidebar
  133. .de VE
  134. .ie n 'mc
  135. .el \{\
  136. .ev 2
  137. .nf
  138. .ti 0
  139. .mk ^t
  140. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  141. .sp -1
  142. .fi
  143. .ev
  144. .\}
  145. .nr ^v 0
  146. ..
  147. '\"    # Special macro to handle page bottom:  finish off current
  148. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  149. '\"    # page bottom macro.
  150. .de ^B
  151. .ev 2
  152. 'ti 0
  153. 'nf
  154. .mk ^t
  155. .if \\n(^b \{\
  156. .\"    Draw three-sided box if this is the box's first page,
  157. .\"    draw two sides but no top otherwise.
  158. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  159. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  160. .\}
  161. .if \\n(^v \{\
  162. .nr ^x \\n(^tu+1v-\\n(^Yu
  163. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  164. .\}
  165. .bp
  166. 'fi
  167. .ev
  168. .if \\n(^b \{\
  169. .mk ^y
  170. .nr ^b 2
  171. .\}
  172. .if \\n(^v \{\
  173. .mk ^Y
  174. .\}
  175. ..
  176. '\"    # DS - begin display
  177. .de DS
  178. .RS
  179. .nf
  180. .sp
  181. ..
  182. '\"    # DE - end display
  183. .de DE
  184. .fi
  185. .RE
  186. .sp .5
  187. ..
  188. .HS place cmds
  189. .BS
  190. '\" Note:  do not modify the .SH NAME line immediately below!
  191. .SH NAME
  192. place \- Geometry manager for fixed or rubber-sheet placement
  193. .VS
  194. .SH SYNOPSIS
  195. \fBplace \fIwindow option value \fR?\fIoption value ...\fR?
  196. .sp
  197. \fBplace configure \fIwindow option value \fR?\fIoption value ...\fR?
  198. .sp
  199. \fBplace dependents \fIwindow\fR
  200. .sp
  201. \fBplace forget \fIwindow\fR
  202. .sp
  203. \fBplace info \fIwindow\fR
  204. .BE
  205.  
  206. .SH DESCRIPTION
  207. .PP
  208. The placer is a geometry manager for Tk.
  209. It provides simple fixed placement of windows, where you specify
  210. the exact size and location of one window, called the \fIslave\fR,
  211. within another window, called the \fImaster\fR.
  212. The placer also provides rubber-sheet placement, where you specify the
  213. size and location of the slave in terms of the dimensions of
  214. the master, so that the slave changes size and location
  215. in response to changes in the size of the master.
  216. Lastly, the placer allows you to mix these styles of placement so
  217. that, for example, the slave has a fixed width and height but is
  218. centered inside the master.
  219. .PP
  220. If the first argument to the \fBplace\fR command is a window path
  221. name or \fBconfigure\fR then the command arranges for the placer
  222. to manage the geometry of a slave whose path name is \fIwindow\fR.
  223. The remaining arguments consist of one or more \fIoption\-value\fR
  224. pairs that specify the way in which \fIwindow\fR's
  225. geometry is managed.
  226. If the placer is already managing \fIwindow\fR, then the
  227. \fIoption\-value\fR pairs modify the configuration for \fIwindow\fR.
  228. In this form the \fBplace\fR command returns an empty string as result.
  229. The following \fIoption\-value\fR pairs are supported:
  230. .TP
  231. \fB\-in \fImaster\fR
  232. \fIMaster\fR specifes the path name of the window relative
  233. to which \fIwindow\fR is to be placed.
  234. \fIMaster\fR must either be \fIwindow\fR's parent or a descendant
  235. of \fIwindow\fR's parent.
  236. In addition, \fImaster\fR and \fIwindow\fR must both be descendants
  237. of the same top-level window.
  238. These restrictions are necessary to guarantee
  239. that \fIwindow\fR is visible whenever \fImaster\fR is visible.
  240. If this option isn't specified then the master defaults to
  241. \fIwindow\fR's parent.
  242. .TP
  243. \fB\-x \fIlocation\fR
  244. \fILocation\fR specifies the x-coordinate within the master window
  245. of the anchor point for \fIwindow\fR.
  246. The location is specified in screen units (i.e. any of the forms
  247. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  248. of the master window.
  249. .TP
  250. \fB\-relx \fIlocation\fR
  251. \fILocation\fR specifies the x-coordinate within the master window
  252. of the anchor point for \fIwindow\fR.
  253. In this case the location is specified in a relative fashion
  254. as a floating-point number:  0.0 corresponds to the left edge
  255. of the master and 1.0 corresponds to the right edge of the master.
  256. \fILocation\fR need not be in the range 0.0\-1.0.
  257. .TP
  258. \fB\-y \fIlocation\fR
  259. \fILocation\fR specifies the y-coordinate within the master window
  260. of the anchor point for \fIwindow\fR.
  261. The location is specified in screen units (i.e. any of the forms
  262. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  263. of the master window.
  264. .TP
  265. \fB\-rely \fIlocation\fR
  266. \fILocation\fR specifies the y-coordinate within the master window
  267. of the anchor point for \fIwindow\fR.
  268. In this case the value is specified in a relative fashion
  269. as a floating-point number:  0.0 corresponds to the top edge
  270. of the master and 1.0 corresponds to the bottom edge of the master.
  271. \fILocation\fR need not be in the range 0.0\-1.0.
  272. .TP
  273. \fB\-anchor \fIwhere\fR
  274. \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
  275. at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
  276. \fB\-relx\fR, and \fB\-rely\fR options.
  277. The anchor point is in terms of the outer area of \fIwindow\fR
  278. including its border, if any.
  279. Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
  280. \fIwindow\fR's border will appear at the given (x,y) location
  281. in the master.
  282. The anchor position defaults to \fBnw\fR.
  283. .TP
  284. \fB\-width \fIsize\fR
  285. \fISize\fR specifies the width for \fIwindow\fR in screen units
  286. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  287. The width will be the outer width of \fIwindow\fR including its
  288. border, if any.
  289. If \fIsize\fR is an empty string, or if no \fB\-width\fR
  290. or \fB\-relwidth\fR option is specified, then the width requested
  291. internally by the window will be used.
  292. .TP
  293. \fB\-relwidth \fIsize\fR
  294. \fISize\fR specifies the width for \fIwindow\fR.
  295. In this case the width is specified as a floating-point number
  296. relative to the width of the master: 0.5 means \fIwindow\fR will
  297. be half as wide as the master, 1.0 means \fIwindow\fR will have
  298. the same width as the master, and so on.
  299. .TP
  300. \fB\-height \fIsize\fR
  301. \fISize\fR specifies the height for \fIwindow\fR in screen units
  302. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  303. The height will be the outer dimension of \fIwindow\fR including its
  304. border, if any.
  305. If \fIsize\fR is an empty string, or if no \fB\-height\fR or
  306. \fB\-relheight\fR option is specified, then the height requested
  307. internally by the window will be used.
  308. .TP
  309. \fB\-relheight \fIsize\fR
  310. \fISize\fR specifies the height for \fIwindow\fR.
  311. In this case the height is specified as a floating-point number
  312. relative to the height of the master: 0.5 means \fIwindow\fR will
  313. be half as high as the master, 1.0 means \fIwindow\fR will have
  314. the same height as the master, and so on.
  315. .TP
  316. \fB\-bordermode \fImode\fR
  317. \fIMode\fR determines the degree to which borders within the
  318. master are used in determining the placement of the slave.
  319. The default and most common value is \fBinside\fR.
  320. In this case the placer considers the area of the master to
  321. be the innermost area of the master, inside any border:
  322. an option of \fB\-x 0\fR corresponds to an x-coordinate just
  323. inside the border and an option of \fB\-relwidth 1.0\fR
  324. means \fIwindow\fR will fill the area inside the master's
  325. border.
  326. If \fImode\fR is \fBoutside\fR then the placer considers
  327. the area of the master to include its border;
  328. this mode is typically used when placing \fIwindow\fR
  329. outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
  330. Lastly, \fImode\fR may be specified as \fBignore\fR, in which
  331. case borders are ignored:  the area of the master is considered
  332. to be its official X area, which includes any internal border but
  333. no external border.  A bordermode of \fBignore\fR is probably
  334. not very useful.
  335. .PP
  336. If the same value is specified separately with
  337. two different options, such as \fB\-x\fR and \fB\-relx\fR, then
  338. the most recent option is used and the older one is ignored.
  339. .PP
  340. The \fBplace dependents\fR command returns a list of all the slave
  341. windows for which \fIwindow\fR is the master.
  342. If there are no slaves for \fIwindow\fR then an empty string is
  343. returned.
  344. .PP
  345. The \fBplace forget\fR command causes the placer to stop managing
  346. the geometry of \fIwindow\fR.  As a side effect of this command
  347. \fIwindow\fR will be unmapped so that it doesn't appear on the
  348. screen.
  349. If \fIwindow\fR isn't currently managed by the placer then the
  350. command has no effect.
  351. \fBPlace forget\fR returns an empty string as result.
  352. .PP
  353. The \fBplace info\fR command returns a list giving the current
  354. configuration of \fIwindow\fR.
  355. The list consists of \fIoption\-value\fR pairs in exactly the
  356. same form as might be specified to the \fBplace configure\fR
  357. command.
  358. If the configuration of a window has been retrieved with
  359. \fBplace info\fR, that configuration can be restored later by
  360. first using \fBplace forget\fR to erase any existing information
  361. for the window and then invoking \fBplace configure\fR with
  362. the saved information.
  363.  
  364. .SH "FINE POINTS"
  365. .PP
  366. It is not necessary for the master window to be the parent
  367. of the slave window.
  368. This feature is useful in at least two situations.
  369. First, for complex window layouts it means you can create a
  370. hierarchy of subwindows whose only purpose
  371. is to assist in the layout of the parent.
  372. The ``real children'' of the parent (i.e. the windows that
  373. are significant for the application's user interface) can be
  374. children of the parent yet be placed inside the windows
  375. of the geometry-management hierarchy.
  376. This means that the path names of the ``real children''
  377. don't reflect the geometry-management hierarchy and users
  378. can specify options for the real children
  379. without being aware of the structure of the geometry-management
  380. hierarchy.
  381. .PP
  382. A second reason for having a master different than the slave's
  383. parent is to tie two siblings together.
  384. For example, the placer can be used to force a window always to
  385. be positioned centered just below one of its
  386. siblings by specifying the configuration
  387. .DS C
  388. \fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR
  389. .DE
  390. Whenever the sibling is repositioned in the future, the slave
  391. will be repositioned as well.
  392. .PP
  393. Unlike many other geometry managers (such as the packer)
  394. the placer does not make any attempt to manipulate the geometry of
  395. the master windows or the parents of slave windows (i.e. it doesn't
  396. set their requested sizes).
  397. To control the sizes of these windows, make them windows like
  398. frames and canvases that provide configuration options for this purpose.
  399.  
  400. .SH KEYWORDS
  401. geometry manager, height, location, master, place, rubber sheet, slave, width
  402. .VE
  403.